<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var arr2 =[8,4,2,8,3,9,6,3,11];
    document.write(arr2)
    var res=[];
    // console.log('处理前' ,arr)
    for(var a=0;a<arr2.length;a++){
        console.log(arr2[a])
        if (res.indexOf(arr2[a])==-1){
            res.push(arr2[a]);
        }
    }

    document.write('处理后:',res,'</br>')





    var arr=[3,2,4,7,9]
    for(var i=0;i<arr.length;i++){
        // console.log(arr[i])
        for (var j=0;j<arr.length-i-1;j++){
            if(arr[j]>arr[j+1]){
                var t =arr[j]
                arr[j]=arr[j+1]
                arr[j+1]=t
            }
        }
    }
    document.write('从小到大冒泡排序：'+arr)








</script>

</body>
</html>